using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class DiseaseMap : EntityTypeConfiguration<Disease>
    {
        public DiseaseMap()
        {
            // Primary Key
            this.HasKey(t => t.diseaseID);

            // Properties
            this.Property(t => t.diseaseName)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Disease");
            this.Property(t => t.diseaseID).HasColumnName("diseaseID");
            this.Property(t => t.diseaseName).HasColumnName("diseaseName");
            this.Property(t => t.departmentID).HasColumnName("departmentID");
            this.Property(t => t.createTime).HasColumnName("createTime");
        }
    }
}
